package shopping;

public abstract class Member {
    private String memberId;
    private char gender;
    private int age;

    public Member(String info) {
        String[] parts = info.split(" ");
        this.memberId = parts[0];
        this.gender = parts[1].charAt(0);
        this.age = Integer.parseInt(parts[2]);
    }

    public String getMemberId() {
        return memberId;
    }

    public char getGender() {
        return gender;
    }

    public int getAge() {
        return age;
    }

    public abstract double consume(int amount);
    
    public abstract String toString();

    public String getGenderAgeCost() {
        return String.format("%s %c %d %.1f", memberId, gender, age, getTotalCost());
    }

    public abstract double getTotalCost();
} 